package com.cyl.manager.act.mapper;

import com.cyl.manager.act.domain.FhMapFishtype1;
import com.cyl.manager.act.domain.FhMapWatercommonfish1;
import com.cyl.manager.act.domain.dto.FhMapWaterD;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 水域管理Mapper接口
 *
 * @author ruoyi
 * @date 2024-11-13
 */
public interface FhMapWaterDTOMapper
{

    /**
     * 新增水域管理
     *
     * @param fhMapWater 水域管理
     * @return 结果
     */
    public int insertFhMapWater(FhMapWaterD fhMapWater);


    @Select("select * from fh_map_fishtype where id = #{id}")
    public FhMapFishtype1 selectFhMapFishtypeById(Long id);
    /**
     * 新增水域常见鱼种管理
     *
     * @param fhMapWatercommonfish 水域常见鱼种管理
     * @return 结果
     */
    @Insert("insert into fh_map_watercommonfish(water_id,water_name,fish_id,fish_name,fish_image,catch_num,status,crate_time) values(#{waterId},#{waterName},#{fishId},#{fishName},#{fishImage},#{catchNum},#{status},#{crateTime})")
    public int  insertFhMapWatercommonfish(FhMapWatercommonfish1 fhMapWatercommonfish);

    /**
     * 根据水域id和鱼id查询
     * @param aLong
     * @param id
     * @return
     */
    @Select("select * from fh_map_watercommonfish where water_id = #{waterId} and fish_id = #{fishId}")
    public Integer selectFhMapWatercommonfishById(@Param("waterId") Long waterId, @Param("fishId") Long fishId);

    @Select("select * from fh_map_water where longitude = #{longitude} and latitude = #{latitude} limit 1")
    public FhMapWaterD selectFhMapWaterByjfd(@Param("longitude") String longitude, @Param("latitude") String latitude);
}
